#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int solve(int x){
    int ans=1;
    while(x!=1){
        if(x%2){
            x=x*3+1;
        }
        else{
            x/=2;
        }
        ans++;
    }
    return ans;
}
int main(void){
    int m,n;
    while(~scanf("%d%d",&m,&n)){
        int s=min(m,n);
        int t=max(m,n);
        int ans=0;
        for(int i=s;i<=t;i++){
            ans=max(ans,solve(i));
        }
        printf("%d %d %d\n",m,n,ans);
    }
    return 0;
}
